﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GnufConfiguration.h"
#include "GnufInfo.h"

class QXmlStreamAttributes;

namespace gnuf {

    struct GNUF_BASE_EXPORT ToolDefinitionData
    {
        std::wstring id;
        bool wantToHandleToggling;
        std::list<Info> infos;

        bool valid() const;
        void reset();
    };

    class ToolDefinitionConfiguration : public Configuration
    {
    public:
        ToolDefinitionConfiguration();
        ~ToolDefinitionConfiguration();
        bool read();
    protected:
        // Inherits from Configuration...
        virtual void parseElement(int, const QXmlStreamReader &) override final;

    private:
        void parseToolDefinition(const QXmlStreamAttributes &);
        void parseInfo(const QXmlStreamAttributes &);
        void parseTooltip(const QXmlStreamAttributes &);

        ToolDefinitionData m_data;
    };
}
